package com.jf.cloud.api.multishop.feign;

import com.jf.cloud.api.multishop.vo.ShopUserVO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "jfcloud-multishop",contextId = "ShopUser")
public interface ShopUserFeignClient {
    /**
     * 根据userId获取商家员工信息
     * @param userId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/shopUser/getByUserId")
    ServerResponseEntity<ShopUserVO> getByUserId(@RequestParam("userId") Long userId);


    /**
     * 根据用户id列表查名称
     * @param userIds 用户id列表
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDER_URL_PREFIX + "/getImShopUserList")
    ServerResponseEntity<List<ShopUserVO>> getImShopUserList(@RequestBody List<Long> userIds);


    /**
     * 根据手机号码查询账户数量
     *
     * @param mobile 手机号码
     * @return 账户数量
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/shopUser/countAccoutByMobile")
    ServerResponseEntity<Integer> countAccoutByMobile(@RequestParam("mobile") String mobile);

    /**
     * 根据店铺id获取店主id
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDER_URL_PREFIX + "/getShopUserIdByShopId")
    ServerResponseEntity<Long> getShopUserIdByShopId(@RequestBody Long shopId);
}
